<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>Document</title>
	<script type="text/javascript">
	dongwu = new Object();/*新建一个对象*/
	dongwu.name ="喵星人";   /*定定义属性*/
	dongwu.color ="橘黄";
	dongwu.sex ='母';
	dongwu.shuijiao=function(){    
		alert('喵星人是个起床困难户');
	}
	dongwu.saitaiyang=function(x){
		alert('喵星人喜欢晒太阳');
		alert(x+'喵星人喜欢晒太阳')
	}

	alert(dongwu.name);
	
	dongwu.shuijiao();   /*调用这个对象的什么方法*/

	dongwu.saitaiyang("我的");

	function kongqi(){
		this.name="空气";
		this.color ='透明';
		this.piao=function(){
			alert('飘');
		}
		this.zuoyong=function(){
			alert('喵星人也离不开空气');
		}
	}
	obj = new kongqi();
	obj.weidao = "没有味道";  /*向kongqi传属性*/
	obj.yongtu=function(){
		alert("我们离不开空气");
	}

	alert(obj.name);
	alert(obj.yongtu());
	alert(obj.zuoyong());



	</script>
</head>
<body>
	
</body>
</html>